<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.tjsinfo.tjsoa.system.vo.User"%>
<%@page import="com.tjsinfo.tjsoa.system.vo.TSystemUser"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>粮油集团办公自动化协作平台</title>
    <meta http-equiv="x-ua-compatible" content="ie=7" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="<%=basePath%>style/txlz7.css" rel="stylesheet" type="text/css" id="txlz7"/>
	<link rel="stylesheet" type="text/css" href="<%=basePath%>ajaxFramework/ext-2.1/resources/css/ext-all.css" />
	<script type="text/javascript" src="<%=basePath%>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
  	<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/ext-all.js"></script>
	<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/source/locale/ext-lang-zh_CN.js"></script>
	
	<script type='text/javascript' src='<%=basePath%>dwr/interface/AddressListGroupBo.js'></script>
	<script type='text/javascript' src="<%=basePath%>dwr/engine.js"></script>
	<script type='text/javascript' src="<%=basePath%>dwr/util.js"></script>
	<style type="text/css">
			td {
				font:12px/170% "宋体", "新宋体", "黑体"; color:#000
			}
			th {
				font:12px/170% "宋体", "新宋体", "黑体"; color:#000
			}
         .trBgColor { background-color:#A4D7E8; cursor: hand;}
         .GroupIndexDiv {
			display: none;
			position: absolute;
			border: 1px solid #FFF;
			border-bottom:none;
			z-index:1002;
			overflow: auto;
		}
		.black_overlays{
			display: none;
			position: absolute;
			top: 0%;
			left: 0%;
			width: 100%;
			height: 100%;
			background-color: #C1EBFC;
			z-index:1002;
			-moz-opacity: 0.8;
			opacity:.80;
			filter: alpha(opacity=30);
		}
	</style>
                
	<%
		TSystemUser tjsUser = (TSystemUser)request.getAttribute("tjsUser");
		Integer userid = (Integer)request.getAttribute("userid");
		String messageid = (String)request.getAttribute("messageid");
		
		String bl = "true";
	 %>
	 <script language="JavaScript" type="text/javascript" >//最大数据量
	function xianshiGroup(){
		document.getElementById("GroupIndexDiv").style.top = document.body.clientHeight/5;
		document.getElementById("GroupIndexDiv").style.left = document.body.clientWidth/6;
		document.getElementById("blackdiv").style.display = "block";
		document.getElementById("GroupIndexDiv").style.display = "block";
		AddressListGroupBo.getGroup(<%=userid %>,"1",GroupName);
	}
		
	function xiaoshiGroup(){
		document.getElementById("GroupIndexDiv").style.display = "none";
		document.getElementById("blackdiv").style.display = "none";
	}
		
	function GroupName(fu){
		var Group = '<table width="100%" class="researchtab"><tr>';
		var i = 0;
		for(var a=0;a<fu.length;a=a+3){
			if(fu[a+1].length>=5){
				if(fu[a+1] == '我的联系人'){
					document.getElementById("groupid").value = fu[a];
					Group += '<td width="30%"><input name="groupidradio" type="radio" alt="'+fu[a+1]+'" id="groupidradio" value="'+fu[a]+'" checked="checked" onclick="fuzhi(\''+fu[a]+'\')"/><a title=\"'+fu[a+1]+'\">'+fu[a+1].substring(0,6)+'</a></td>';
				}else{
					Group += '<td width="30%"><input name="groupidradio" type="radio" alt="'+fu[a+1]+'" id="groupidradio" value="'+fu[a]+'" onclick="fuzhi(\''+fu[a]+'\')"/><a title=\"'+fu[a+1]+'\" onclick="fuzhi(\''+fu[a]+'\')">'+fu[a+1].substring(0,6)+'</a></td>';
				}
			}else{
				Group += '<td width="30%"><input name="groupidradio" type="radio" alt="'+fu[a+1]+'" id="groupidradio" value="'+fu[a]+'" onclick="fuzhi(\''+fu[a]+'\')"/>'+fu[a+1]+'</td>';
			}
			i++;
			if(i%3 == 0){
				Group += '</tr><tr>';
			}else if(a == fu.length-1){
				Group += '</tr>';
			}
		}
		var GroupDiv = document.getElementById("GroupDiv");
		GroupDiv.innerHTML = Group;
	}
	
	function submitform1(str){
		document.getElementById("returnType").value = str;
		if(str == 'yes'){
			if(document.getElementById("groupid").value != null && document.getElementById("groupid").value != ''){
				document.form1.submit();
			}else{
				Ext.MessageBox.alert('提示框','<nobr>请选择联系人所在组</nobr>');		
			}
		}else{
			document.form1.submit();
		}
	}
	
	function fuzhi(str){
		document.getElementById("groupid").value = str;
	}
	
	function guanbi(){
		window.close();
	}
</script>
  </head>
  
  <body>
    <div id="right">
      <div class="contact_content" style="height: 95.9%">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td background="<%=basePath%>images/bghui.gif" width="99%" height="98">&nbsp;</td>
          </tr>
          <tr>
            <td align="center">
             <table width="360" border="0" cellpadding="0" cellspacing="0" >
               <tr>
                 <td background="<%=basePath%>images/tishitop.gif" height="12">
               </tr>
               <tr>
                 <td background="<%=basePath%>images/tishimiddle.gif" height="100%">
                     <table width="100%" height="46" border="0" cellpadding="0" cellspacing="0">
                     <br />
                      <tr align="center">
                        <td width="32%"><img src="<%=basePath%>images/iconwen.gif" /></td>
                        <td width="62%" align="left" valign="middle">用户<strong><%=tjsUser.getUserName() %></strong>允许您同步他的联系信息，您是否接受?</td>
                        <td width="6%">&nbsp;</td>
                      </tr>
                      <tr>
                        <td width="32%"></td>
                        <td width="62%" align="left" valign="middle">
                        <%
                        	if(bl.equals("true")){
                         %>
                        <a href="javaScript:xianshiGroup();"><img src="<%=basePath%>images/shi.gif" /></a>&nbsp;&nbsp;
                        <%
                        	}else{
                        %>
                        <a href="javaScript:submitform1('yes');"><img src="<%=basePath%>images/shi.gif" /></a>&nbsp;&nbsp;
                        <%
                        	}
                         %>
                        <a href="javaScript:submitform1('no');"><img src="<%=basePath%>images/fou.gif" /></a>
                        </td>
                        <td width="6%">&nbsp;</td>
                      </tr>
                      <tr>
                        <td width="32%">&nbsp;</td>
                        <td width="62%" align="left" valign="middle"></td>
                        <td width="6%">&nbsp;</td>
                      </tr>
                     </table>
                  </td>
               </tr>
               <tr>
                 <td background="images/tishibottom.gif" height="13">
               </tr>
             </table>
            </td>
          </tr>
      </table>

         
      </div>
</div>
<div id="blackdiv" class="black_overlays">
	<iframe style="width:100%;height:100%;filter:alpha(opacity=0);-moz-opacity:0"></iframe>
</div>
<div id="GroupIndexDiv" class="GroupIndexDiv">
    <table width="342" border="0" cellpadding="0" cellspacing="0" >
               <tr>
                 <td background="images/small_04.gif" height="25" align="left">
                 <table width="99%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="8%" style="padding-left:15px; padding-top:3px;"><img src="<%=basePath%>images/icon_07.gif" /></td>
                        <td width="86%" style="padding-left:10px; color:#FFFFFF; font-weight:bold;padding-top:3px">接收联系人组</td>
                        <td width="6%" valign="bottom">
							<div class="cha">
								<img src="<%=basePath%>images/cha.gif"
									onclick="javaScript:xiaoshiGroup();"
											style="cursor: hand" />
							</div>
						</td>
                      </tr>
                    </table>
                 </td>
               </tr>
               <tr>
                 <td align="center" class="zz">
                     <table width="90%" height="180" border="0" cellspacing="0" cellpadding="0">
                      <tr><td colspan="3" align="left">
                       <div id="GroupDiv"></div>
                      </td>
                      </tr>
                      <tr><td colspan="3" style="border-top:1px #CFCFD1 solid">&nbsp;</td></tr>
                      <tr>
                        <td colspan="3" align="center"><a href="javaScript:submitform1('yes');"><img src="<%=basePath%>images/qd.gif" /></a>&nbsp;&nbsp;
                        <a href="javaScript:xiaoshiGroup();"><img src="<%=basePath%>images/qx.gif" />
                        </td>
                       </tr>
                      <tr>
                        <td colspan="3">&nbsp;</td>
                     </tr>
                    </table>
                 </td>
               </tr>
             </table>
</div>
<form action="<%=basePath %>tjsinfo/tjsoa/addresslist/returnSynchronization.do" name="form1" method="post">
	<input type="hidden" name="tjsUserId" value="<%=tjsUser.getUserId() %>"/>
	<input type="hidden" name="returnType" id="returnType"/>
	<input type="hidden" name="groupid" id="groupid"/>
	<input type="hidden" name="userid" id="userid"  value="<%=userid %>"/>
	<input type="hidden" name="messageid" id="messageid"  value="<%=messageid %>"/>
</form>
  </body>
</html>
